package com.hqyj.qinyong;

import com.hqyj.common.pojo.SysUser;
import com.hqyj.common.service.IBaseTopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;
import java.util.HashMap;

/**
 * QY
 *
 * @ClassName: qyGenerateController
 * 试卷生成 Controller
 * @author: qinyong
 * @date: 2021/10/20 17:04
 */
@RestController
@RequestMapping("/qy")
public class qyGenerateController {
    @Autowired
    IBaseTopicService baseTopicService;

    /**
     * 试卷随机生成
     * @param testPaper
     * @param oneQuantity
     * @param ManyQuantity
     * @param judgeQuantity
     * @param briefQuantity
     * @param session
     * @return
     */
    @RequestMapping("/generate")
    public HashMap<String,Object> generate(String testPaper, int oneQuantity,
                                           int ManyQuantity, int judgeQuantity,
                                           int briefQuantity,  HttpSession session){
        SysUser sysUser = new SysUser();
        sysUser.setUserId(1);
        session.setAttribute("user",sysUser);
        return baseTopicService.generatePaperMap(testPaper,oneQuantity,ManyQuantity,
                judgeQuantity,briefQuantity,session);
    }

}
